<%@language=vbscript%>
<!--#include file=..\getFormName.inc-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="vi">
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link rel=stylesheet href="..\CSS\FormStyle.css" type="text/css">
<script language="javascript" src="..\JS\toolBarButton.js"></script>
</head>
<!--#include file="..\jvGrid.inc"-->
<!--#include file="..\RootContent.inc"-->
<%
	bdate=Request("bdate")
	if bdate="" then
		bdate=date()
	end if
		bchon=Request("bchon")
	if bchon="" then
		bchon="CHUONGTRINH"
	end if
	select case bchon
		case "CHUONGTRINH"
			bten="LICH"
		case "TONGHOP"
			bten="TH"
		case "KETLUAN"
			bten="KQ"
	end select
	Set bDir=server.CreateObject("ActiveFile.Directory")
     bPathFolder=RootContent & "giaoban\"& Nam(Formatdate(bdate)) &"\thang"
     bDir.Path=bPathFolder
     if not bDir.Exists() then
	    	call bDir.Create(bPathFolder)
	end if
	Set bDir=nothing
	set TextFile=server.CreateObject("Vinalines.ClsFile")
	Path=bPathFolder & "\"& bten &"_" & Thang(Formatdate(bdate)) & "_" & Nam(Formatdate(bdate)) & ".VT"
	btext=TextFile.ReadTextFile(Path)
	Set TextFile=nothing
%>
<!--#include file="..\jvfunction.inc"-->
<script language=VBScript runat=server>
Function FormatDate(vDate)
	   If Not IsNull(vDate) Then
	        vM = Right("0" & Month(vDate), 2)
	        vD = Right("0" & Day(vDate), 2)
	        vY = Right("19" & Year(vDate), 4)
	        FormatDate = vD & "/" & vM & "/" & vY
	End If
End Function
Function ModiString(mess_s)
		message = Replace("" & mess_s,"'", "''")
		ModiString=message
End function
Function SaveDate(vDate)
		dim bvitri1
		dim bvitri2
	   vDate=trim(cstr(vDate))
	   bvitri1=instr(1,vDate,"/")
	   bMonth=left(vDate,bvitri1-1)
	   bvitri2=instr(bvitri1+1,vDate,"/")
	   Dim Temp
	   Temp=right(vDate,len(vDate)-bvitri1)
	   bDay=left(Temp,bvitri2-bvitri1-1)
	   bYear=right(vDate,len(vDate)-bvitri2)
       SaveDate=bDay+"/"+bMonth+"/"+bYear
End Function
	Function Ngay(strdate)
		Ngay=cint(mid(strdate,1,2))
	End Function
	Function Thang(strdate)
		Thang=cint(mid(strdate,4,2))
	End Function
	Function Nam(strdate)
		Nam=cint(mid(strdate,7,4))
	End Function

</script>
<SCRIPT LANGUAGE=javascript>
function cbodate_onchange(){
	bdate=Noidung.cbothang.value+"/01/"+Noidung.cbonam.value
	bchon=Noidung.cbochon.value;
	window.Noidung.target="right"
	window.Noidung.action="frmttgbthang.asp?bdate="+bdate+"&bchon="+bchon;
	window.Noidung.submit();
}
function cbochon_onchange(){
	bdate=Noidung.cbothang.value+"/01/"+Noidung.cbonam.value
	bchon=Noidung.cbochon.value;
	window.Noidung.target="right"
	window.Noidung.action="frmttgbthang.asp?bdate="+bdate+"&bchon="+bchon;
	window.Noidung.submit();
}
</Script>
<body bgcolor=#F8F9D9 leftmargin=2 topmargin=0 style="font-family:times new roman" >
<form name="Noidung" method="post">
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#7491DC" height=27>
	<tr> 
		<td align="left" valign="bottom" background='..\images\Tabs\tab_top_background_runner.gif'>
			<table onclick="window.location.replace('frmttgbtuan.asp')" style="cursor: hand;" border="0" cellspacing="0" cellpadding="0" align="left">
				<tr> 
					<td><img src="..\images\Tabs\tab_off_left.gif" height="24" width="16"></td>
					<td background="..\images\Tabs\tab_off_middle.gif">Tuần</td>
					<td><img src="..\images\Tabs\tab_off_right.gif" height="24" width="16"></td>
				</tr>
			</table>
			<table border="0" cellspacing="0" cellpadding="0" align="left">
				<tr> 
					<td><img src="..\images\Tabs\tab_on_left.gif" height="24"></td>
					<td background="..\images\Tabs\tab_on_middle.gif">Tháng</td>
					<td><img src="..\images\Tabs\tab_on_right.gif" height="24"></td>
				</tr>
			</table>
			<table onclick="window.location.replace('frmttgbquy.asp')" style="cursor: hand;" border="0" cellspacing="0" cellpadding="0" align="left">
				<tr> 
					<td><img src="..\images\Tabs\tab_off_left.gif" height="24" width="16"></td>
					<td background="..\images\Tabs\tab_off_middle.gif">Quý</td>
					<td><img src="..\images\Tabs\tab_off_right.gif" height="24" width="16"></td>
				</tr>
			</table>
			<table onclick="window.location.replace('frmttgbnam.asp')" style="cursor: hand;" border="0" cellspacing="0" cellpadding="0" align="left">
				<tr> 
					<td><img src="..\images\Tabs\tab_off_left.gif" height="24" width="16"></td>
					<td background="..\images\Tabs\tab_off_middle.gif">Năm</td>
					<td><img src="..\images\Tabs\tab_off_right.gif" height="24" width="16"></td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<table cellspacing=0 cellpadding=0 border=0 style="table-layout: fixed; height: 1px">
	<tr><td style="width: 100%; height: 1px; background-color:#D6D3CE">&nbsp;</td></tr>
</table>
<table cellspacing=0 cellpadding=0 border=0 style="table-layout: fixed; height: 1px">
	<tr><td style="width: 100%; height: 1px; background-color: 808080">&nbsp;</td></tr>
</table>
<table class=tblHeader id=ListHeader border=0 cellspacing=0 cellpadding=0>
<tr>
<td width=15%>
<select size=1 name="cbothang" style="font-family: Arial;font-size:12px; text-align:center; position: relative; width:100%" LANGUAGE=javascript onchange="return cbodate_onchange()">
<%for i=1 to 12%>
<%if Thang(Formatdate(bdate))=i then%>
<option value="<%=i%>" selected>Tháng <%=i%></option>
<%else%>
<option value="<%=i%>">Tháng <%=i%></option>
<%end if%>
<%next%>
</select>
</td>
<td width=11%>
<select size=1 name="cbonam" style="font-family: Arial;font-size:12px; text-align:center; position: relative; width:100%" LANGUAGE=javascript onchange="return cbodate_onchange()">
<%for i=2000 to Nam(Formatdate(date()))%>
<%if Nam(Formatdate(bdate))=i then%>
<option value="<%=i%>" selected><%=i%></option>
<%else%>
<option value="<%=i%>"><%=i%></option>
<%end if%>
<%next%>
</select>
</td>
<td width=25%>
<select size=1 name="cbochon" style="font-family: Arial;font-size:12px; text-align:center; position: relative; width:100%" LANGUAGE=javascript onchange="return cbochon_onchange()">
<%if bchon="CHUONGTRINH" then%>
	<option value="CHUONGTRINH" selected>Chương trình giao ban</option>
	<option value="TONGHOP">Tổng hợp giao ban</option>
	<option value="KETLUAN">Kết luận giao ban</option>
<%end if%>
<%if bchon="TONGHOP" then%>
	<option value="CHUONGTRINH">Chương trình giao ban</option>
	<option value="TONGHOP" selected>Tổng hợp giao ban</option>
	<option value="KETLUAN">Kết luận giao ban</option>
<%end if%>
<%if bchon="KETLUAN" then%>
	<option value="CHUONGTRINH">Chương trình giao ban</option>
	<option value="TONGHOP">Tổng hợp giao ban</option>
	<option value="KETLUAN" selected>Kết luận giao ban</option>
<%end if%>
</select>
</td>
<td width=49% style="font-family:tahoma;font-size:11px"><b>&nbsp;&nbsp;Thông tin giao ban tháng&nbsp;<%=Thang(Formatdate(bdate))%>&nbsp;năm&nbsp;<%=Nam(Formatdate(bdate))%></b></td>
</tr>
</table>
<table cellspacing=0 cellpadding=0 border=0 style="table-layout: fixed; height: 1px">
	<tr><td style="width: 100%; height: 1px; background-color: #FFFFFF"></td></tr>
</table>
<table border="0" bgcolor="#F8F9D9" cellpadding="0" cellspacing="0" width="100%">
</tr>
<td width="100%">&nbsp;</td>
</tr>
</table>
<table border="0" bgcolor="#F8F9D9" cellpadding="0" cellspacing="0" width="100%">
</tr>
<td width="100%">
<font face="Arial" size=2><%=btext%></font>
</td>
</tr>
</table>
</form>
</body>